[#rt][#include "/WEB-INF/pages/common/taglibs.ftl"]
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>Site</title>
		<meta name="menu" content="CategoryMenu"/> 
		<meta name="heading" content="heading"/>
		<script type="text/javascript" src="[@c.url value='/js/plugins/jquery.alerts.js'/]"></script>
		<script type="text/javascript">
			var change = function($input) {
				var status = $input.is(":checked");
				if (status) {
					$('input[name="defaultUrl"]').attr('disabled', 'disabled');
				} else {
					$('input[name="defaultUrl"]').removeAttr('disabled');
				}
			}
			$(function(){
				// ①、status更新
				$('#submit1').click(function(){
					var $input = $('#siteStatus');
					var status = $input.is(":checked");
					var text = (status ? "开放" : "关闭");
					var url = "[@c.url value='/manage/Site_status.action'/]";
					jConfirm('您已将站点设置为【<b>'+text+'</b>】状态,请您再次确认该操作!', '提示对话框', function(r) {
						if (r) {
							var params = $("#form1").serialize();
							$.get(url, params, function(result, status, respose){
								if (status =='success') {
									jAlert(result.trim(), '提示信息.');
									$('#status').text('【'+text+'】');
								} else {
									jAlert('更新失败,请联系管理员.', '提示信息.');
								}
							});
						}
					});
					return false;
				})
				// ②、suffix更新
				$('#submit2').click(function() {
					var suffix = $('#suffix').val();
					var url = "[@c.url value='/manage/Site_suffix.action'/]";
					jConfirm('站点前台访问URL后缀设置为【<b>'+suffix+'</b>】,请您再次确认该操作!', '提示对话框', function(r) {
						if (r) {
							var params = $("#form2").serialize();
							$.get(url, params, function(result, status, respose){
								if (status =='success') {
									jAlert(result.trim(), '提示信息.');
									$('#status').text('【'+text+'】');
								} else {
									jAlert('更新失败,请联系管理员.', '提示信息.');
								}
							});
						}
					});
					return false;
				})
			});
		</script>
	</head>
	<body id="body">
		<div class="widgetbox">
        	<div class="title"><h2 class="tabbed"><span>站点信息设置</span></h2></div>
			<div class="widgetcontent padding0">
                <div id="tabs">
                    <ul>
                        <li><a href="#tabs-1">站点状态设置</a></li>
                        <li><a href="#tabs-2">站点后缀设置</a></li>
                        <li><a href="#tabs-3">站点资源设置</a></li>
                    </ul>
                    <div id="tabs-1" class="userlistwidget">
                        <ul>
                        	<li>
                        		<div class="notification msgalert show">
			                        <p>如果站点已关闭，后台管理仍可继续访问。</p>
			                    </div>
								<form action="[@c.url value='/manage/Site_status.action'/]" method="post" class="stdform stdform2" id="form1">
			                    	<p>
			                        	<label style="line-height:36px;vertical-align:bottom;">
			                        		<img src="/cms/images/computer.png" alt=""/>
			                        		<a href="javascript:void(0);">站点状态设置</a><br>
			                        		当前站点正处于 <b id="status" style="color:blue;">[#if site == null || (site.isClose == false)]【开放】[#else]【关闭】[/#if] </b>状态.
			                        	</label>
			                            <span class="field">
			                            	<input id="siteStatus" type="checkbox" class="yes_no" rel="{labelOn: '开放', labelOff: '关闭', easing: 'swing', duration: 200, change:change}" name="open" value="true" [#if site == null || (site.isClose == false)]checked="checked"[/#if]></input>
			                            	<br/>
			                            	<input type="text" class="smallinput" placeholder="网站关闭后的默认跳转页" [#if site == null || (site.isClose == false)]disabled="disabled"[/#if] name="defaultUrl" value="${site.defaultUrl!''}"/> &nbsp;网站关闭后的默认跳转页.
			                            	<br/>
			                            </span>
			                        </p>
			                        <p class="stdformbutton">
			                        	<input type="hidden" name="ajax" value="true" />
			                        	<button class="submit radius2" id="submit1" >提交</button>
			                            <input type="reset" value="重置" class="reset radius2"/>
			                        </p>
			                    </form>
                            </li>
                            [#--<li>
                            	<div class="avatar"><img alt="" src="images/avatar2.png"></div>
                                <div class="info">
                                	<a href="">Billie Norris</a> <br>
                                    Software Engineer <br> 18 minutes ago
                                </div><!--info-->
                            </li>--]
                        </ul>
                        <br clear="all">
                        <a class="more" href="javascript:void(0);">Read More</a>
                    </div>
                    <div id="tabs-2" class="userlistwidget">
						<ul>
                        	<li>
                        		[#--<div class="notification msgalert show">
			                        <p>如果站点设置了WEB缓存, 修改后缀请及时清除缓存,以便释放系统资源。</p>
			                    </div>--]
								<form action="[@c.url value='/manage/Site_suffix.action'/]" method="post" class="stdform stdform2" id="form2">
			                    	<p>
			                        	<label style="line-height:36px;vertical-align:bottom;">
			                        		<img src="/cms/images/computer.png" alt=""/>
			                        		<a href="javascript:void(0);">URL后缀设置</a><br>
			                        	</label>
			                            <span class="field">
			                            	<input type="text" class="atomicinput" placeholder="url后缀" id="suffix" name="suffix" value="${site.suffix!''}"/> &nbsp;
			                            	<br/>建议使用 "html"、"jhtml"、"do"、"jsp"、"asp"、"php" 等常用的一种后缀作为url后缀, 不推荐使用空后缀.
			                            	<br/>如果站点设置了WEB缓存, 修改后缀请及时清除缓存,以便释放系统资源。
			                            </span>
			                        </p>
			                    	<p>
			                        	<label style="line-height:36px;vertical-align:bottom;">
			                        		<a href="javascript:void(0);">访问协议设置</a><br>
			                        	</label>
			                            <span class="field">
			                            	<select name="protocol" class="tinyinput">
			                            		<option value="http">http://</option>
			                            		<option value="https">https://</option>
			                            	</select> &nbsp;
			                            	<br/>网络传输协议,如果设置为 "https://", 需要制作证书后，重启WEB服务。
			                            </span>
			                        </p>
			                        <p class="stdformbutton">
			                        	<input type="hidden" name="ajax" value="true" />
			                        	<button class="submit radius2" id="submit2" >提交</button>
			                            <input type="reset" value="重置" class="reset radius2"/>
			                        </p>
			                    </form>
                            </li>
                            [#--<li>
                            	<div class="avatar"><img alt="" src="images/avatar2.png"></div>
                                <div class="info">
                                	<a href="">Billie Norris</a> <br>
                                    Software Engineer <br> 18 minutes ago
                                </div><!--info-->
                            </li>--]
                        </ul>
                        <br clear="all">
                    </div>
                    <div id="tabs-3">
                        <ul class="thumb">
                            <li><a href="#"><img src="" alt="" /></a></li>
                        </ul>     
                    </div>
                </div><!--#tabs-->
            </div><!--widgetcontent-->
        </div>
		<script type="text/javascript">
		//<![CDATA[
			$(function(){
				var theme = getTheme();
				//默认源码模式
			})		
		//]]></script>
		<div style="clear:both;"></div>
	</body>
</html>